package com.tech.distribute_id;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;

/**
 * 生成策略
 */
public abstract class AbstractDistributeIdStrategy implements BeanNameGenerator {

    public abstract StrategyTypeEnum getStrategyType();

    public abstract String getDistributeId() throws Exception;

    @Override
    public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
        return getStrategyType().name();
    }

}
